﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:diagnostics="clr-namespace:System.Diagnostics;assembly=WindowsBase"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:WpfHero="clr-namespace:WpfHero"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
    xmlns:WpfHero1="clr-namespace:WpfHero;assembly=WHEngine"
    xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
    x:Class="WpfHero.Window1"
    Title="Window1" Height="606" Width="632" x:Name="window">

	<Window.Resources>
		<LinearGradientBrush x:Key="TextBoxBorder" MappingMode="Absolute" EndPoint="0,20" StartPoint="0,0">
			<GradientStop Color="#ABADB3" Offset="0.05"/>
			<GradientStop Color="#E2E3EA" Offset="0.07"/>
			<GradientStop Color="#E3E9EF" Offset="1"/>
		</LinearGradientBrush>
		<Storyboard x:Key="sbMissed">
			<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.Visibility)">
				<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="00:00:00.1000000" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="00:00:00.2000000" Value="{x:Static Visibility.Collapsed}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock" Storyboard.TargetProperty="(TextElement.FontSize)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="20"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.1000000" Value="12"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="MultiplierChanged">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="tbMultiplier">
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00.3000000" Value="7.74"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:01" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="tbMultiplier">
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00.3000000" Value="7.74"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:01" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="tbMultiplier">
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00.3000000" Value="-55.5"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:01" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="tbMultiplier">
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:00.3000000" Value="101.093"/>
				<SplineDoubleKeyFrame KeySpline="0,0,0.291,0.962" KeyTime="00:00:01" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="tbMultiplier">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="1"/>
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0.29"/>
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Style x:Key="TextBoxStyle1" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
			<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="AllowDrop" Value="true"/>
			<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type TextBox}">
						<Microsoft_Windows_Themes:ListBoxChrome SnapsToDevicePixels="true" x:Name="Bd" BorderThickness="{TemplateBinding BorderThickness}" RenderFocused="{TemplateBinding IsKeyboardFocusWithin}" RenderMouseOver="{TemplateBinding IsMouseOver}">
							<ScrollViewer SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" x:Name="PART_ContentHost"/>
						</Microsoft_Windows_Themes:ListBoxChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Background" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
								<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
        <ObjectDataProvider x:Key="SongBrowserDS" d:IsDataSource="True" ObjectType="{x:Type WpfHero:SongBrowser}" />
            <Storyboard x:Key="ShowLoading">
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lbSongBrowser" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="-120"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lbSongBrowser" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="-41"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="lbSongBrowser" Storyboard.TargetProperty="(UIElement.Visibility)">
				<DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Collapsed}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="textBlock1" Storyboard.TargetProperty="(UIElement.Visibility)">
				<DiscreteObjectKeyFrame KeyTime="00:00:00.3000000" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="413" KeySpline="0,0,0.171,1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="18" KeySpline="0,0,0.171,1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
				<SplineDoubleKeyFrame KeyTime="00:00:01" Value="360" KeySpline="0,0,0.171,1"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.Visibility)">
				<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="StartPlaying">
			<!--<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="-3"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
				<SplineDoubleKeyFrame KeyTime="00:00:02" Value="2"/>
			</DoubleAnimationUsingKeyFrames> -->
			<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="scroller" Storyboard.TargetProperty="(UIElement.Opacity)">
				<SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
				<SplineDoubleKeyFrame KeyTime="00:00:05" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="cvLoading" Storyboard.TargetProperty="(UIElement.Visibility)">
				<DiscreteObjectKeyFrame KeyTime="00:00:00" Value="{x:Static Visibility.Collapsed}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
	</Window.Resources>
	<Window.DataContext>
		<WpfHero1:WHEngine IsButton1Pressed="False">
			<WpfHero1:WHEngine.Gemline1Gems>
				<WpfHero1:GemModel EndAt="00:00:01" StartAt="00:00:00" />
			</WpfHero1:WHEngine.Gemline1Gems>
			<WpfHero1:WHEngine.Gemline2Gems>
				<WpfHero1:GemModel EndAt="00:00:01" StartAt="00:00:00.5" />
			</WpfHero1:WHEngine.Gemline2Gems>
		</WpfHero1:WHEngine>
	</Window.DataContext>
	<Window.Triggers>
		<EventTrigger RoutedEvent="TextBoxBase.TextChanged" SourceName="tbMissed">
			<BeginStoryboard Storyboard="{StaticResource sbMissed}" x:Name="sbMissed_BeginStoryboard"/>
		</EventTrigger>
		<EventTrigger RoutedEvent="TextBoxBase.TextChanged" SourceName="tbMultiplier">
			<BeginStoryboard Storyboard="{StaticResource MultiplierChanged}" x:Name="MultiplierChanged_BeginStoryboard"/>
		</EventTrigger>
	</Window.Triggers>

	<Grid>
        <Button Height="23" Margin="109.08,8,0,0" x:Name="button1" VerticalAlignment="Top" Click="button1_Click" HorizontalAlignment="Left" Width="166.92" Content="Play song"/>
		<ToggleButton x:Name="bt1" Width="31" Height="45" HorizontalAlignment="Left" Margin="100.834,113,0,0" VerticalAlignment="Top" IsChecked="{Binding Path=IsButton1Pressed, Mode=Default}" Content="F1">
			<ToggleButton.Background>
				<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
					<GradientStop Color="#FFF3F3F3" Offset="0"/>
					<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
					<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
					<GradientStop Color="#FFD8A0A0" Offset="1"/>
				</LinearGradientBrush>
			</ToggleButton.Background>
        </ToggleButton>
		<ToggleButton x:Name="bt2" Width="31" Height="44" HorizontalAlignment="Left" Margin="100.834,161,0,0" VerticalAlignment="Top" IsChecked="{Binding Path=IsButton2Pressed, Mode=Default}" Content="F2">
			<ToggleButton.Background>
				<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
					<GradientStop Color="#FFF3F3F3" Offset="0"/>
					<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
					<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
					<GradientStop Color="#FFD0D89D" Offset="1"/>
				</LinearGradientBrush>
			</ToggleButton.Background>
        </ToggleButton>
		<ToggleButton x:Name="bt3" Width="31" HorizontalAlignment="Left" Margin="100.834,209,0,0" VerticalAlignment="Top" Height="41" IsChecked="{Binding Path=IsButton3Pressed, Mode=Default}" Content="F3">
			<ToggleButton.Background>
				<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
					<GradientStop Color="#FFF3F3F3" Offset="0"/>
					<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
					<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
					<GradientStop Color="#FF745BDE" Offset="1"/>
				</LinearGradientBrush>
			</ToggleButton.Background>
        </ToggleButton>
		<ToggleButton x:Name="bt4" Width="31" HorizontalAlignment="Left" Margin="100.834,254,0,273" IsChecked="{Binding Path=IsButton4Pressed, Mode=Default}" Content="F4">
			<ToggleButton.Background>
				<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
					<GradientStop Color="#FFF3F3F3" Offset="0"/>
					<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
					<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
					<GradientStop Color="#FFEA9BBC" Offset="1"/>
				</LinearGradientBrush>
			</ToggleButton.Background>
        </ToggleButton>
		<ToggleButton x:Name="bt5" Width="31" HorizontalAlignment="Left" Margin="100.834,0,0,221.5" IsChecked="{Binding Path=IsButton5Pressed, Mode=Default}" VerticalAlignment="Bottom" Height="47.5" Content="F5">
			<ToggleButton.Background>
				<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
					<GradientStop Color="#FFF3F3F3" Offset="0"/>
					<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
					<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
					<GradientStop Color="#FF71BF6B" Offset="1"/>
				</LinearGradientBrush>
			</ToggleButton.Background>
        </ToggleButton>
		<TextBlock d:LayoutOverrides="Width, Height" HorizontalAlignment="Right" Margin="0,84,66,0" VerticalAlignment="Top" Width="64" Height="25" Text="{Binding Path=Engine.Gemline1Gems.Count, ElementName=window, Mode=Default}" TextWrapping="Wrap"/>
		<WpfHero:SongScroller Margin="159,113,34.7,213" x:Name="scroller" Width="Auto"/>
		<TextBlock HorizontalAlignment="Left" Margin="19,65,0,0" VerticalAlignment="Top" Width="44" Height="44" Text="{Binding Path=Engine.IsButton1Pressed, ElementName=window, Mode=Default}" TextWrapping="Wrap"/>
		<ToggleButton x:Name="btStroke" Width="48" HorizontalAlignment="Left" Margin="100.834,0,0,170" IsChecked="{Binding Path=IsStrumKeyPressed, Mode=Default}" Height="47.5" VerticalAlignment="Bottom" Content="Shift">
			<ToggleButton.Background>
				<LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
					<GradientStop Color="#FFF3F3F3" Offset="0"/>
					<GradientStop Color="#FFEBEBEB" Offset="0.5"/>
					<GradientStop Color="#FFDDDDDD" Offset="0.5"/>
					<GradientStop Color="#FFFF6B0D" Offset="1"/>
				</LinearGradientBrush>
			</ToggleButton.Background>
		</ToggleButton>
		<StackPanel Margin="19,50,8,0" VerticalAlignment="Top" Height="30" Orientation="Horizontal">
			<TextBox Text="Score" TextWrapping="Wrap"/>
			<TextBox Text="{Binding Path=Score, Mode=Default}" TextWrapping="Wrap"/>
			<TextBox Text="Hits" TextWrapping="Wrap"/>
			<TextBox Text="{Binding Path=TotalHits, Mode=Default}" TextWrapping="Wrap"/>
			<TextBox Text="Hits in a row" TextWrapping="Wrap"/>
			<TextBox Text="{Binding Path=HitsInARow, Mode=Default}" TextWrapping="Wrap"/>
			<TextBox Text="Missed" TextWrapping="Wrap"/>
			<TextBox Text="{Binding Path=MissedGemCount, Mode=Default}" TextWrapping="Wrap" x:Name="tbMissed"/>
			<TextBox Text="Unneccessary strums" TextWrapping="Wrap"/>
			<TextBox Text="{Binding Path=UnneccessaryStrums, Mode=Default}" TextWrapping="Wrap"/>
			<TextBox Text="Multiplier" TextWrapping="Wrap"/>
		</StackPanel>
		<TextBox Text="{Binding Path=Multiplier, Mode=Default}" TextWrapping="Wrap" RenderTransformOrigin="0.5,0.5" HorizontalAlignment="Right" Margin="0,50,95.53,0" x:Name="tbMultiplier" VerticalAlignment="Top" Width="44.47" Height="30" Style="{DynamicResource TextBoxStyle1}">
			<TextBox.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</TextBox.RenderTransform>
		</TextBox>
		<TextBlock HorizontalAlignment="Left" Margin="19,96,0,0" VerticalAlignment="Top" Width="44" Height="23" Text="MISS!" TextWrapping="Wrap" Visibility="Collapsed" x:Name="textBlock"/>
		<ListBox ItemsSource="{Binding Path=SubDirectories, Mode=Default, Source={StaticResource SongBrowserDS}}" HorizontalAlignment="Left" Margin="8,0,0,56" VerticalAlignment="Bottom" Width="88.834" Height="200" x:Name="lbSongBrowser" MouseDoubleClick="lbSongBrowser_MouseDoubleClick" ItemTemplate="{DynamicResource SubDirectoriesTemplate}" KeyUp="lbSongBrowser_KeyUp" RenderTransformOrigin="0.5,0.5">
			<ListBox.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</ListBox.RenderTransform>
		</ListBox>
		<Canvas Margin="212,-186,193,0" VerticalAlignment="Top" Height="132" x:Name="cvLoading" RenderTransformOrigin="0.5,0.5">
			<Canvas.RenderTransform>
				<TransformGroup>
					<ScaleTransform ScaleX="1" ScaleY="1"/>
					<SkewTransform AngleX="0" AngleY="0"/>
					<RotateTransform Angle="0"/>
					<TranslateTransform X="0" Y="0"/>
				</TransformGroup>
			</Canvas.RenderTransform>
			<TextBlock Width="203" Height="110" Text="Loading" TextWrapping="Wrap" FontSize="48" Visibility="Collapsed" x:Name="textBlock1"/>
		</Canvas>
	</Grid>
</Window>
